package com.vhall.component.controller.rbac.adm;

import com.vhall.component.entity.rbac.vo.*;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author longzhen.gong
 * @date 2021/6/10 15:32
 */
@FeignClient(name = "RbacAdminRoleFacade", path = "/v4/rbac/admin/role")
public interface RbacAdminRoleFacade {

    /**
     * 获取角色信息
     *
     * @param reqVO 请求参数
     * @return 响应结果
     */
    @TokenAuth
    @RequestMapping(value = "/get")
    RoleAdminGetRspVO getRoleInfo(@Validated RoleAdminGetReqVO reqVO);


    /**
     * 获取角色列表
     *
     * @param reqVO 请求参数
     * @return 响应结果
     */
    @TokenAuth
    @GetMapping(value = "/list")
    RoleAdminListRspVO getRoleList(@Validated RoleAdminListReqVO reqVO);

    /**
     * 角色添加
     *
     * @param reqVo 请求参数
     * @return 响应结果
     */
    @TokenAuth
    @PostMapping(value = "/add")
    RoleAdminAddRspVO addRole(@Validated RoleAdminAddReqVO reqVo);


    /**
     * 角色编辑
     *
     * @param reqVo 请求参数
     * @return 响应结果
     */
    @TokenAuth
    @PostMapping(value = "/edit")
    Integer editRole(@Validated RoleAdminEditReqVO reqVo);

    /**
     * 角色删除
     *
     * @param reqVo 请求参数
     * @return 响应结果
     */
    @TokenAuth
    @PostMapping(value = "/delete-all")
    List<Integer> deleteRole(@Validated RoleAdminDeleteReqVO reqVo);


    /**
     * 角色-编辑菜单权限
     *
     * @return 返回值
     */
    @TokenAuth
    @ApiOperation("角色-编辑菜单权限")
    @PostMapping(value = "/edit-menues")
    Boolean editMenues(@Validated EditMenuesReqVO vo);

    /**
     * 角色-编辑操作权限
     *
     * @return 返回值
     */
    @TokenAuth
    @ApiOperation("角色-编辑菜单权限")
    @PostMapping(value = "/edit-actions")
    Boolean editAction(@Validated EditActionReqVO reqVO);

    /**
     * 角色-编辑菜单权限
     *
     * @return 返回值
     */
    @TokenAuth
    @ApiOperation("角色-菜单列表")
    @PostMapping(value = "/menu-list")
    List<AdminMenuListRspVo> menuList(@Validated AdminMenuListReqVo reqVo);

    /**
     * 操作列表
     *
     * @param reqVO 参数
     * @return 返回值
     */
    @TokenAuth
    @ApiOperation("操作列表")
    @GetMapping(value = "/action-list")
    List<ActionsRspVO> actionList(@Validated ActionListReqVO reqVO);
}
